package com.zjitc.utils;

import javax.servlet.http.Cookie;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/21 14:05
 * @description:
 */
public class CookieUtils {
  public static Cookie getCookieByName(String name, Cookie[] cookies) {
    if(cookies!=null){
      for (Cookie c : cookies) {
        //通过名称获取
        if(name.equals(c.getName())){
          //返回
          return c;
        }
      }
    }
    return null;
  }

}
